package com.zzl.service.impl;

import com.zzl.entiey.PsGoods;
import com.zzl.mapper.GoodsMapper;
import com.zzl.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: GoodsServiceImpl
 * @Description: GOOD
 * @author: ZZL
 * @date: 2021/7/7  14:18
 */
@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    GoodsMapper goodsMapper;

    @Override
    public List<PsGoods> findAllGoodsByType(String goodsType) {
        List<PsGoods> goods = goodsMapper.findAllGoodsByType(goodsType);
        return goods;
    }

    @Override
    public PsGoods findGoodsByName(String goodsName) {
        PsGoods goodsByName = goodsMapper.findGoodsByName(goodsName);
        return goodsByName;
    }

    @Override
    public Integer findGoodsNumber(String goodsName) {
        return goodsMapper.findGoodsNumber(goodsName);
    }

    @Override
    public List<PsGoods> findAllGoods() {
        return goodsMapper.findAllGoods();
    }

    @Override
    public void editGoods(PsGoods psGoods) {
        goodsMapper.editGoods(psGoods);
    }

    @Override
    public void deletedGoodsByGoodsName(String goodsName) {
        goodsMapper.deletedGoodsByGoodsName(goodsName);
    }

    @Override
    public void insertGoods(PsGoods psGoods) {
        goodsMapper.insertGoods(psGoods);
    }
}
